<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<html>
<head>
<title>On-line users</title>
</head>
<link rel="stylesheet" href="../../resources/css/fw-list.css"
	type="text/css">
<script src="../../script/base.js"></script>
<script src="../../script/list.js"></script>
<script>
	var contextPath = "<c:out value='${pageContext.request.contextPath}'/>";
</script>

<body bgcolor="white">
	<f:view>
		<f:loadBundle basename="net.orange.conf.lang.fw" var="msg" />
		<h:inputHidden value="#{device.datas.rowCount}" id="rowCount" />

		<h:form id="listForm">
			<table align="center" width="100%">
				<tr>
					<td><h:panelGrid columns="2" rowClasses="table-text-3"
							style="width:100%;">
							<h:panelGroup>
								<h:outputText value="User Name:" />
								<h:inputText id="sr_user_name" value="#{device.sr_user_name}" />

								<h:outputText value="    " />

								<h:outputText value="Mobile Phone:" />
								<h:inputText id="sr_mobile_phone"
									value="#{device.sr_mobile_phone}" />

								<h:outputText value="Nick Name:" />
								<h:inputText id="sr_nickname" value="#{device.sr_nickname}" />
							</h:panelGroup>

							<h:panelGroup style="text-align:right">
								<h:commandButton id="cmdSubmit" value="#{msg.common_summit}"
									onclick="searchInit()" action="#{device.search}"
									styleClass="button-normal" />

								<h:outputText value="    " />
								<h:commandButton id="cmdCancel" type="reset"
									value="#{msg.common_cancel}" styleClass="button-normal" />
							</h:panelGroup>
						</h:panelGrid>
					</td>
				</tr>
				<tr>
					<td>
						<hr></td>
				</tr>
				<tr>
					<td>
						<table align="center">
							<tr>
								<td class="table-text-3" nowrap>Online users count:</td>
								<td class="table-text-blue-title"><b><h:outputText
											value="#{device.onlineUsers}" /> </b>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="content-message"><h:messages />
					</td>
				</tr>
				<tr>
					<td><h:dataTable id="table" value="#{device.datas}"
							styleClass="listing-table" var="the" rowClasses="table-text"
							headerClass="column-head">

							<h:column>
								<f:facet name="header">
									<h:outputText value="User Id" />
								</f:facet>
								<h:outputText value="#{the.user_id}" styleClass="table-text-red"
									rendered="#{the.online}" />
								<h:outputText value="#{the.user_id}"
									rendered="#{not the.online}" />
							</h:column>

							<h:column>
								<f:facet name="header">
									<h:outputText value="User Name" />
								</f:facet>
								<h:outputText value="#{the.user_name}"
									styleClass="table-text-red" rendered="#{the.online}" />
								<h:outputText value="#{the.user_name}"
									rendered="#{not the.online}" />
							</h:column>

							<h:column>
								<f:facet name="header">
									<h:outputText value="Nick Name" />
								</f:facet>
								<h:outputText value="#{the.nickname}"
									styleClass="table-text-red" rendered="#{the.online}" />
								<h:outputText value="#{the.nickname}"
									rendered="#{not the.online}" />
							</h:column>

							<h:column>
								<f:facet name="header">
									<h:outputText value="Mobile phone" />
								</f:facet>
								<h:outputText value="#{the.mobile_phone}"
									styleClass="table-text-red" rendered="#{the.online}" />
								<h:outputText value="#{the.mobile_phone}"
									rendered="#{not the.online}" />
							</h:column>

							<h:column>
								<f:facet name="header">
									<h:outputText value="IMEI #" />
								</f:facet>
								<h:outputText value="#{the.imei_number}"
									styleClass="table-text-red" rendered="#{the.online}" />
								<h:outputText value="#{the.imei_number}"
									rendered="#{not the.online}" />
							</h:column>
							
							<h:column>
								<f:facet name="header">
									<h:outputText value="" />
								</f:facet>

								<h:commandButton id="cmdPing" type="submit"
									value="Ping" action="#{device.ping}"
									styleClass="button-edit" />

								<h:outputText value=" " />

							</h:column>
						</h:dataTable>
					</td>
				</tr>
				<tr>
					<td><h:panelGrid columns="1" rowClasses="table-text-3"
							style="width:100%;text-align:right">
							<h:panelGroup>
								<h:outputText value="#{msg.common_page}: #{device.pageLabel} " />

								<h:commandLink action="#{device.firstPage}"
									rendered="#{not device.firstPage}">
									<h:outputText value="#{msg.common_firstpage}| " />
								</h:commandLink>

								<h:commandLink action="#{device.previousPage}"
									rendered="#{not device.firstPage}">
									<h:outputText value="#{msg.common_perviouspage}| " />
								</h:commandLink>

								<h:commandLink action="#{device.nextPage}"
									rendered="#{not device.lastPage}">
									<h:outputText value="#{msg.common_nextpage}| " />
								</h:commandLink>

								<h:commandLink action="#{device.lastPage}"
									rendered="#{not device.lastPage}">
									<h:outputText value="#{msg.common_lastpage}" />
								</h:commandLink>
							</h:panelGroup>
						</h:panelGrid>
					</td>
				</tr>
			</table>
		</h:form>
	</f:view>
</body>
</html>
